package gameobject.construct;

import com.jme3.material.Material;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
import gameobject.item.RequiredItemHolder;
import gameobject.item.Shovel;
import mygame.DataStore;
import mygame.Vector3i;
import mygame.Voxel;

public class GrassBlock extends BaseBlock implements NaturalConstruct {

    public static GrassBlock createInstance() {
        return GrassBlock.createInstance(DEFAULT_BASE_VOXEL_LOCATION);
    }

    public static GrassBlock createInstance(Vector3i baseVoxelGridLocation) {
        GrassBlock instance = new GrassBlock();
        instance.init(baseVoxelGridLocation);
        return instance;
    }

    @Override
    protected void addModel() {
	Geometry fakeModel = new Geometry();
	Material mat = new Material(DataStore.assetManager, "Common/MatDefs/Light/Lighting.j3md");
	mat.setTexture("DiffuseMap", DataStore.assetManager.loadTexture("Textures/Terrain/splat/grass.jpg"));
        fakeModel.setMaterial(mat);
	fakeModel.setMesh(new Box(Voxel.VOXEL_EXTENT, Voxel.VOXEL_EXTENT, Voxel.VOXEL_EXTENT));
	attachChild(fakeModel);
    }

    @Override
    protected void addStartingInventory() {}

    @Override
    protected void addRequiredToBuild() {}

    @Override
    protected void addRequiredToHarvest() {
	requiredItemsToHarvest.get(RequiredItemHolder.CHARACTER).add(new Shovel());
    }
}
